Skip to content

🐛 Potentially fix crash on exit on iOS - #348

Merged
fuzzybinary merged 1 commit into
developfrom
jward/RUMM-3069-close-crash
Feb 23, 2023
Merged

fuzzybinary merged 1 commit into
developfrom
jward/RUMM-3069-close-crash

Conversation

@fuzzybinary

Copy link
Copy Markdown
Member

What and why?

Fix a crash on exit caused by Datadog logging that a view isn't active during an event, which is happening while the app is shutting down and a the Flutter engine, and therefore the method channel for displaying the log, is no longer available.

To fix, we're overriding the method provided by Flutter for de-registering the plugin with the engine on shutdown, but I've yet to see this called in practice.

Fixes #341

How?

This crash is difficult to reproduce, but I have not been able to with this code enabled in many attempts. I added some code to the RUM example to test stopping a view and immediately send an event on dispose if one is active, which was able to reproduce the crash fairly consistently, and I have not been able to reproduce.

Review checklist

  • This pull request has appropriate unit and / or integration tests
  • This pull request references a Github or JIRA issue

CI Configuration (optional)

  • Run unit tests
  • Run integration tests

Override the method for de-registering the plugin with the engine on shutdown.

This crash is difficult to reproduce, but I have not been able to with this code enabled.

Fixes #341
@fuzzybinary
fuzzybinary requested a review from a team as a code owner February 22, 2023 19:55

@plousada plousada left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@fuzzybinary
fuzzybinary merged commit 88411e9 into develop Feb 23, 2023
@fuzzybinary
fuzzybinary deleted the jward/RUMM-3069-close-crash branch February 23, 2023 14:40
@fuzzybinary fuzzybinary mentioned this pull request Apr 24, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS Crash DataDog Version 1.2.1

2 participants